/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Cliente;

import PaqueteCORBA.excepcion;
import java.awt.Color;
import java.util.Calendar;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableColumnModel;

/**
 *
 * @author careigma
 */
public class ClienteGUI extends javax.swing.JFrame {

	private PaqueteCORBA.InfoExamenEspecifico ee;
	/**
	 * Examen especifico generado para el alumno
	 */
	private PaqueteCORBA.InfoExamenEspecifico ieeA;
	private int nPreg = 0;
	/**
	 * Número de pregunta actual del examen que el alumno está realizando
	 */
	private int nPregAlu = 0;
	/**
	 * Identificador del examen que el alumno está actualmente resolviendo
	 */
	private String idExamenR;
	private int limitePregsTA = 3;
	private boolean preguntaAnyadida = false;

	/**
	 * Creates new form ClienteGUI
	 */
	public ClienteGUI() {
		initComponents();
		cliente = new Cliente(this);
		this._incorrectLoginLabel.setVisible(false);
	}

	/**
	 * This method is called from within the constructor to initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is always
	 * regenerated by the Form Editor.
	 */
	@SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        _ventanaPrincipalP = new javax.swing.JFrame();
        jPanel1 = new javax.swing.JPanel();
        anyadirPreguntaVPP = new javax.swing.JButton();
        ponerExamenVPP = new javax.swing.JButton();
        verExamenesVPP = new javax.swing.JButton();
        salirVPP = new javax.swing.JButton();
        matricularVPP = new javax.swing.JButton();
        _ventanaPrincipalA = new javax.swing.JFrame();
        jPanel7 = new javax.swing.JPanel();
        verNotificacionesBotonVPA = new javax.swing.JButton();
        verExamenesA = new javax.swing.JButton();
        salirVPP1 = new javax.swing.JButton();
        matricularseA = new javax.swing.JButton();
        _anyadirPreguntaP = new javax.swing.JFrame();
        jButton7 = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JSeparator();
        jPanel2 = new javax.swing.JPanel();
        listaAsignaturasAPP = new javax.swing.JComboBox();
        listaTemasAPP = new javax.swing.JComboBox();
        jScrollPane1 = new javax.swing.JScrollPane();
        enunciadoNuevaPregunta = new javax.swing.JTextArea();
        jLabel2 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        okRespuestaAP = new javax.swing.JRadioButton();
        jButton6 = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        tablaRespuestasAP = new javax.swing.JTable();
        jScrollPane7 = new javax.swing.JScrollPane();
        enunciadoNuevaRespuesta = new javax.swing.JTextArea();
        _ponerExamen = new javax.swing.JFrame();
        jPanel5 = new javax.swing.JPanel();
        listaAsignaturasPE = new javax.swing.JComboBox();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        listaTemasPE = new javax.swing.JComboBox();
        nPregsPE = new javax.swing.JTextField();
        anyadirBotonPE = new javax.swing.JButton();
        jLabel7 = new javax.swing.JLabel();
        jScrollPane3 = new javax.swing.JScrollPane();
        tablaTemasPE = new javax.swing.JTable();
        jLabel6 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        dateFechaInicio = new datechooser.beans.DateChooserCombo();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        dateFechaFin = new datechooser.beans.DateChooserCombo();
        aceptarBotonPEP = new javax.swing.JButton();
        jButton10 = new javax.swing.JButton();
        _verExamenesP = new javax.swing.JFrame();
        listaExamenesVE = new javax.swing.JComboBox();
        jScrollPane4 = new javax.swing.JScrollPane();
        tablaExamenesVE = new javax.swing.JTable();
        volverVEP = new javax.swing.JButton();
        verExamenVEP = new javax.swing.JButton();
        _elegirAsignaturas = new javax.swing.JFrame();
        jComboBox6 = new javax.swing.JComboBox();
        jButton13 = new javax.swing.JButton();
        jScrollPane5 = new javax.swing.JScrollPane();
        jList1 = new javax.swing.JList();
        jButton14 = new javax.swing.JButton();
        _examenResueltoP = new javax.swing.JFrame();
        jPanel6 = new javax.swing.JPanel();
        jButton17 = new javax.swing.JButton();
        jScrollPane9 = new javax.swing.JScrollPane();
        preguntaERP = new javax.swing.JTextArea();
        jLabel16 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        jLabel19 = new javax.swing.JLabel();
        jScrollPane12 = new javax.swing.JScrollPane();
        respuestaOkERP = new javax.swing.JTextArea();
        jLabel20 = new javax.swing.JLabel();
        jScrollPane13 = new javax.swing.JScrollPane();
        respuestaAluERP = new javax.swing.JTextArea();
        labelNPregERP = new javax.swing.JLabel();
        jButton18 = new javax.swing.JButton();
        jButton19 = new javax.swing.JButton();
        _verExamenesA = new javax.swing.JFrame();
        volverVerExamenesA = new javax.swing.JButton();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel9 = new javax.swing.JPanel();
        jScrollPane8 = new javax.swing.JScrollPane();
        tablaNotificacionesA = new javax.swing.JTable();
        hacerExamen = new javax.swing.JButton();
        jPanel10 = new javax.swing.JPanel();
        jScrollPane16 = new javax.swing.JScrollPane();
        tablaExamenesFinA = new javax.swing.JTable();
        verExamenA = new javax.swing.JButton();
        _examenResueltoA = new javax.swing.JFrame();
        jPanel8 = new javax.swing.JPanel();
        jButton20 = new javax.swing.JButton();
        jScrollPane10 = new javax.swing.JScrollPane();
        preguntaERA = new javax.swing.JTextArea();
        jLabel18 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        jScrollPane14 = new javax.swing.JScrollPane();
        respuestaOkERA = new javax.swing.JTextArea();
        jLabel23 = new javax.swing.JLabel();
        jScrollPane15 = new javax.swing.JScrollPane();
        respuestaAluERA = new javax.swing.JTextArea();
        labelNPregERA = new javax.swing.JLabel();
        jButton21 = new javax.swing.JButton();
        volverExamenResueltoA = new javax.swing.JButton();
        _verNotificacionesA = new javax.swing.JFrame();
        jScrollPane11 = new javax.swing.JScrollPane();
        tablaExamenesA1 = new javax.swing.JTable();
        volverVerExamenesA1 = new javax.swing.JButton();
        verExamenA1 = new javax.swing.JButton();
        _matricularA = new javax.swing.JFrame();
        jPanel13 = new javax.swing.JPanel();
        listaAsigMatricA = new javax.swing.JComboBox();
        jLabel25 = new javax.swing.JLabel();
        jScrollPane19 = new javax.swing.JScrollPane();
        tablaAsigMatricA = new javax.swing.JTable();
        matricButtonA = new javax.swing.JButton();
        atrasMatricA = new javax.swing.JButton();
        _hacerExamen = new javax.swing.JFrame();
        jPanel11 = new javax.swing.JPanel();
        jButton22 = new javax.swing.JButton();
        jScrollPane17 = new javax.swing.JScrollPane();
        preguntaHE = new javax.swing.JTextArea();
        jLabel26 = new javax.swing.JLabel();
        jLabel27 = new javax.swing.JLabel();
        labelNPregHE = new javax.swing.JLabel();
        jButton23 = new javax.swing.JButton();
        terminarExamen = new javax.swing.JButton();
        jScrollPane20 = new javax.swing.JScrollPane();
        tablaRespuestasHE = new javax.swing.JTable();
        _matricularP = new javax.swing.JFrame();
        jPanel14 = new javax.swing.JPanel();
        listaAsigMatricP = new javax.swing.JComboBox();
        jLabel28 = new javax.swing.JLabel();
        jScrollPane21 = new javax.swing.JScrollPane();
        tablaAsigMatricP = new javax.swing.JTable();
        matricButtonP = new javax.swing.JButton();
        atrasMatricP = new javax.swing.JButton();
        _usuarioLabel = new javax.swing.JLabel();
        _passwordLabel = new javax.swing.JLabel();
        _userInput = new javax.swing.JTextField();
        _passwordInput = new javax.swing.JPasswordField();
        _loginButton = new javax.swing.JButton();
        _incorrectLoginLabel = new javax.swing.JLabel();

        _ventanaPrincipalP.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        anyadirPreguntaVPP.setText("Añadir pregunta");
        anyadirPreguntaVPP.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                anyadirPreguntaVPPActionPerformed(evt);
            }
        });

        ponerExamenVPP.setText("Poner examen");
        ponerExamenVPP.setPreferredSize(new java.awt.Dimension(135, 25));
        ponerExamenVPP.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ponerExamenVPPActionPerformed(evt);
            }
        });

        verExamenesVPP.setText("Ver notas");
        verExamenesVPP.setPreferredSize(new java.awt.Dimension(135, 25));
        verExamenesVPP.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                verExamenesVPPActionPerformed(evt);
            }
        });

        salirVPP.setText("Salir");
        salirVPP.setPreferredSize(new java.awt.Dimension(100, 50));
        salirVPP.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                salirVPPActionPerformed(evt);
            }
        });

        matricularVPP.setText("Matricular");
        matricularVPP.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                matricularVPPActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(176, 176, 176)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(anyadirPreguntaVPP, javax.swing.GroupLayout.DEFAULT_SIZE, 197, Short.MAX_VALUE)
                    .addComponent(verExamenesVPP, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(ponerExamenVPP, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(matricularVPP, javax.swing.GroupLayout.DEFAULT_SIZE, 197, Short.MAX_VALUE))
                .addGap(0, 203, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(salirVPP, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(32, Short.MAX_VALUE)
                .addComponent(matricularVPP, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(anyadirPreguntaVPP, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(verExamenesVPP, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(ponerExamenVPP, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(22, 22, 22)
                .addComponent(salirVPP, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        javax.swing.GroupLayout _ventanaPrincipalPLayout = new javax.swing.GroupLayout(_ventanaPrincipalP.getContentPane());
        _ventanaPrincipalP.getContentPane().setLayout(_ventanaPrincipalPLayout);
        _ventanaPrincipalPLayout.setHorizontalGroup(
            _ventanaPrincipalPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        _ventanaPrincipalPLayout.setVerticalGroup(
            _ventanaPrincipalPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        _ventanaPrincipalA.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        verNotificacionesBotonVPA.setText("Ver notificaciones");
        verNotificacionesBotonVPA.setPreferredSize(new java.awt.Dimension(135, 25));
        verNotificacionesBotonVPA.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                verNotificacionesBotonVPAActionPerformed(evt);
            }
        });

        verExamenesA.setText("Ver exámenes");
        verExamenesA.setPreferredSize(new java.awt.Dimension(135, 25));
        verExamenesA.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                verExamenesAActionPerformed(evt);
            }
        });

        salirVPP1.setText("Salir");
        salirVPP1.setPreferredSize(new java.awt.Dimension(100, 50));
        salirVPP1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                salirVPP1ActionPerformed(evt);
            }
        });

        matricularseA.setText("Matricularse");
        matricularseA.setPreferredSize(new java.awt.Dimension(135, 25));
        matricularseA.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                matricularseAActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(salirVPP1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGap(176, 176, 176)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(verExamenesA, javax.swing.GroupLayout.DEFAULT_SIZE, 197, Short.MAX_VALUE)
                    .addComponent(verNotificacionesBotonVPA, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(matricularseA, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 197, Short.MAX_VALUE))
                .addGap(0, 203, Short.MAX_VALUE))
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
                .addContainerGap(88, Short.MAX_VALUE)
                .addComponent(matricularseA, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(verExamenesA, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(verNotificacionesBotonVPA, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(22, 22, 22)
                .addComponent(salirVPP1, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        javax.swing.GroupLayout _ventanaPrincipalALayout = new javax.swing.GroupLayout(_ventanaPrincipalA.getContentPane());
        _ventanaPrincipalA.getContentPane().setLayout(_ventanaPrincipalALayout);
        _ventanaPrincipalALayout.setHorizontalGroup(
            _ventanaPrincipalALayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        _ventanaPrincipalALayout.setVerticalGroup(
            _ventanaPrincipalALayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        _anyadirPreguntaP.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        _anyadirPreguntaP.setResizable(false);
        _anyadirPreguntaP.setSize(new java.awt.Dimension(517, 707));

        jButton7.setText("Atrás");
        jButton7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton7ActionPerformed(evt);
            }
        });

        listaAsignaturasAPP.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                listaAsignaturasAPPActionPerformed(evt);
            }
        });

        enunciadoNuevaPregunta.setColumns(20);
        enunciadoNuevaPregunta.setRows(5);
        jScrollPane1.setViewportView(enunciadoNuevaPregunta);

        jLabel2.setText("Pregunta");

        jLabel4.setText("Asignatura");

        jLabel5.setText("Tema");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(32, 32, 32)
                        .addComponent(jLabel2))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(69, 69, 69)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 299, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel4)
                                    .addComponent(jLabel5))
                                .addGap(35, 35, 35)
                                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(listaAsignaturasAPP, 0, 293, Short.MAX_VALUE)
                                    .addComponent(listaTemasAPP, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))))
                .addContainerGap(52, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(25, 25, 25)
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel4)
                    .addComponent(listaAsignaturasAPP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel5)
                    .addComponent(listaTemasAPP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(18, Short.MAX_VALUE))
        );

        jLabel3.setText("Respuestas");

        okRespuestaAP.setText("Correcta");

        jButton6.setText("Añadir");
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });

        tablaRespuestasAP.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                " ", "Respuesta", "OK"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.String.class, java.lang.Boolean.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        tablaRespuestasAP.setFocusCycleRoot(true);
        tablaRespuestasAP.getTableHeader().setResizingAllowed(false);
        jScrollPane2.setViewportView(tablaRespuestasAP);

        enunciadoNuevaRespuesta.setColumns(20);
        enunciadoNuevaRespuesta.setRows(5);
        jScrollPane7.setViewportView(enunciadoNuevaRespuesta);

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGap(35, 35, 35)
                .addComponent(jLabel3)
                .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 299, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(okRespuestaAP)
                            .addComponent(jButton6)))
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 396, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(47, 47, 47))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(okRespuestaAP)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jButton6))
                    .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(30, 30, 30)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(76, 76, 76))
        );

        javax.swing.GroupLayout _anyadirPreguntaPLayout = new javax.swing.GroupLayout(_anyadirPreguntaP.getContentPane());
        _anyadirPreguntaP.getContentPane().setLayout(_anyadirPreguntaPLayout);
        _anyadirPreguntaPLayout.setHorizontalGroup(
            _anyadirPreguntaPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, _anyadirPreguntaPLayout.createSequentialGroup()
                .addGap(0, 6, Short.MAX_VALUE)
                .addGroup(_anyadirPreguntaPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, _anyadirPreguntaPLayout.createSequentialGroup()
                        .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 505, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, _anyadirPreguntaPLayout.createSequentialGroup()
                        .addComponent(jButton7)
                        .addGap(45, 45, 45))))
        );
        _anyadirPreguntaPLayout.setVerticalGroup(
            _anyadirPreguntaPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(_anyadirPreguntaPLayout.createSequentialGroup()
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, 266, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jButton7)
                .addContainerGap(125, Short.MAX_VALUE))
        );

        _ponerExamen.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        _ponerExamen.setResizable(false);
        _ponerExamen.setSize(new java.awt.Dimension(635, 652));

        listaAsignaturasPE.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                listaAsignaturasPEActionPerformed(evt);
            }
        });

        jLabel9.setText("Asignatura");

        jLabel10.setText("Tema");

        nPregsPE.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                nPregsPEKeyTyped(evt);
            }
        });

        anyadirBotonPE.setText("Añadir");
        anyadirBotonPE.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                anyadirBotonPEActionPerformed(evt);
            }
        });

        jLabel7.setText("Temas añadidos");

        tablaTemasPE.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Tema", "Preguntas"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.Integer.class
            };
            boolean[] canEdit = new boolean [] {
                false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane3.setViewportView(tablaTemasPE);

        jLabel6.setText("Número de preguntas del tema");

        jLabel8.setText("Fecha");

        dateFechaInicio.setCalendarPreferredSize(new java.awt.Dimension(300, 200));

        jLabel11.setText("Inicio");

        jLabel12.setText("Fin");

        try {
            dateFechaFin.setDefaultPeriods(new datechooser.model.multiple.PeriodSet(new datechooser.model.multiple.Period(new java.util.GregorianCalendar(2012, 6, 4),
                new java.util.GregorianCalendar(2012, 6, 4))));
    } catch (datechooser.model.exeptions.IncompatibleDataExeption e1) {
        e1.printStackTrace();
    }

    aceptarBotonPEP.setText("Aceptar");
    aceptarBotonPEP.setEnabled(false);
    aceptarBotonPEP.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            aceptarBotonPEPActionPerformed(evt);
        }
    });

    jButton10.setText("Cancelar");
    jButton10.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton10ActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
    jPanel5.setLayout(jPanel5Layout);
    jPanel5Layout.setHorizontalGroup(
        jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel5Layout.createSequentialGroup()
            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel5Layout.createSequentialGroup()
                    .addGap(32, 32, 32)
                    .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel7)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(jPanel5Layout.createSequentialGroup()
                                .addGap(8, 8, 8)
                                .addComponent(listaTemasPE, javax.swing.GroupLayout.PREFERRED_SIZE, 251, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(234, 234, 234)
                                .addComponent(anyadirBotonPE))
                            .addComponent(jLabel9)
                            .addGroup(jPanel5Layout.createSequentialGroup()
                                .addComponent(jLabel10)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel6)))
                        .addComponent(jLabel8)))
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 444, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel5Layout.createSequentialGroup()
                            .addGap(40, 40, 40)
                            .addComponent(listaAsignaturasPE, javax.swing.GroupLayout.PREFERRED_SIZE, 249, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(jPanel5Layout.createSequentialGroup()
                            .addGap(375, 375, 375)
                            .addComponent(nPregsPE, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(jPanel5Layout.createSequentialGroup()
                            .addGap(48, 48, 48)
                            .addComponent(jLabel11)
                            .addGap(18, 18, 18)
                            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(jPanel5Layout.createSequentialGroup()
                                    .addComponent(aceptarBotonPEP)
                                    .addGap(132, 132, 132)
                                    .addComponent(jButton10))
                                .addGroup(jPanel5Layout.createSequentialGroup()
                                    .addComponent(dateFechaInicio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(42, 42, 42)
                                    .addComponent(jLabel12)
                                    .addGap(18, 18, 18)
                                    .addComponent(dateFechaFin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))))))
            .addContainerGap(25, Short.MAX_VALUE))
    );
    jPanel5Layout.setVerticalGroup(
        jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
            .addGap(21, 21, 21)
            .addComponent(jLabel9)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(listaAsignaturasPE, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jLabel10)
                .addComponent(jLabel6))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(listaTemasPE, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(nPregsPE, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(anyadirBotonPE))
            .addGap(18, 18, 18)
            .addComponent(jLabel7)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 275, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
            .addComponent(jLabel8)
            .addGap(8, 8, 8)
            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jLabel11)
                .addComponent(dateFechaInicio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(jLabel12)
                .addComponent(dateFechaFin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 57, Short.MAX_VALUE)
            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(aceptarBotonPEP)
                .addComponent(jButton10))
            .addGap(47, 47, 47))
    );

    javax.swing.GroupLayout _ponerExamenLayout = new javax.swing.GroupLayout(_ponerExamen.getContentPane());
    _ponerExamen.getContentPane().setLayout(_ponerExamenLayout);
    _ponerExamenLayout.setHorizontalGroup(
        _ponerExamenLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
    );
    _ponerExamenLayout.setVerticalGroup(
        _ponerExamenLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(_ponerExamenLayout.createSequentialGroup()
            .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );

    _verExamenesP.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    _verExamenesP.setMinimumSize(new java.awt.Dimension(460, 475));
    _verExamenesP.setResizable(false);
    _verExamenesP.setSize(new java.awt.Dimension(517, 475));

    listaExamenesVE.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            listaExamenesVEActionPerformed(evt);
        }
    });

    tablaExamenesVE.setModel(new javax.swing.table.DefaultTableModel(
        new Object [][] {

        },
        new String [] {
            "Alumno", "Nota"
        }
    ) {
        Class[] types = new Class [] {
            java.lang.String.class, java.lang.String.class
        };

        public Class getColumnClass(int columnIndex) {
            return types [columnIndex];
        }
    });
    tablaExamenesVE.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            tablaExamenesVEMouseClicked(evt);
        }
    });
    jScrollPane4.setViewportView(tablaExamenesVE);

    volverVEP.setText("Volver");
    volverVEP.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            volverVEPActionPerformed(evt);
        }
    });

    verExamenVEP.setText("Ver examen");
    verExamenVEP.setEnabled(false);
    verExamenVEP.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            verExamenVEPActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout _verExamenesPLayout = new javax.swing.GroupLayout(_verExamenesP.getContentPane());
    _verExamenesP.getContentPane().setLayout(_verExamenesPLayout);
    _verExamenesPLayout.setHorizontalGroup(
        _verExamenesPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(_verExamenesPLayout.createSequentialGroup()
            .addGap(40, 40, 40)
            .addGroup(_verExamenesPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(listaExamenesVE, javax.swing.GroupLayout.PREFERRED_SIZE, 198, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(_verExamenesPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 375, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, _verExamenesPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(verExamenVEP, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(volverVEP, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
            .addContainerGap(45, Short.MAX_VALUE))
    );
    _verExamenesPLayout.setVerticalGroup(
        _verExamenesPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(_verExamenesPLayout.createSequentialGroup()
            .addGap(28, 28, 28)
            .addComponent(listaExamenesVE, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 275, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addGap(18, 18, 18)
            .addComponent(verExamenVEP)
            .addGap(24, 24, 24)
            .addComponent(volverVEP)
            .addContainerGap(39, Short.MAX_VALUE))
    );

    jComboBox6.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

    jButton13.setText("Añadir");

    jList1.setModel(new javax.swing.AbstractListModel() {
        String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
        public int getSize() { return strings.length; }
        public Object getElementAt(int i) { return strings[i]; }
    });
    jScrollPane5.setViewportView(jList1);

    jButton14.setText("Fin");

    javax.swing.GroupLayout _elegirAsignaturasLayout = new javax.swing.GroupLayout(_elegirAsignaturas.getContentPane());
    _elegirAsignaturas.getContentPane().setLayout(_elegirAsignaturasLayout);
    _elegirAsignaturasLayout.setHorizontalGroup(
        _elegirAsignaturasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(_elegirAsignaturasLayout.createSequentialGroup()
            .addGap(33, 33, 33)
            .addGroup(_elegirAsignaturasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                .addComponent(jButton14)
                .addGroup(_elegirAsignaturasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(_elegirAsignaturasLayout.createSequentialGroup()
                        .addGap(6, 6, 6)
                        .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 316, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(_elegirAsignaturasLayout.createSequentialGroup()
                        .addComponent(jComboBox6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(67, 67, 67)
                        .addComponent(jButton13))))
            .addContainerGap(45, Short.MAX_VALUE))
    );
    _elegirAsignaturasLayout.setVerticalGroup(
        _elegirAsignaturasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(_elegirAsignaturasLayout.createSequentialGroup()
            .addGap(21, 21, 21)
            .addGroup(_elegirAsignaturasLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jComboBox6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(jButton13))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
            .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addGap(18, 18, 18)
            .addComponent(jButton14)
            .addContainerGap(51, Short.MAX_VALUE))
    );

    _examenResueltoP.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    _examenResueltoP.setResizable(false);
    _examenResueltoP.setSize(new java.awt.Dimension(517, 707));

    jButton17.setText(">");
    jButton17.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton17ActionPerformed(evt);
        }
    });

    preguntaERP.setColumns(20);
    preguntaERP.setEditable(false);
    preguntaERP.setRows(5);
    jScrollPane9.setViewportView(preguntaERP);

    jLabel16.setText("Nota: ");

    jLabel17.setText("Pregunta:");

    jLabel19.setText("Respuesta:");

    respuestaOkERP.setColumns(20);
    respuestaOkERP.setEditable(false);
    respuestaOkERP.setRows(5);
    jScrollPane12.setViewportView(respuestaOkERP);

    jLabel20.setText("Respuesta correcta:");

    respuestaAluERP.setBackground(new java.awt.Color(0, 153, 51));
    respuestaAluERP.setColumns(20);
    respuestaAluERP.setEditable(false);
    respuestaAluERP.setRows(5);
    jScrollPane13.setViewportView(respuestaAluERP);

    labelNPregERP.setText("01/10");

    jButton18.setText("<");
    jButton18.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton18ActionPerformed(evt);
        }
    });

    jButton19.setText("Volver");
    jButton19.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton19ActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
    jPanel6.setLayout(jPanel6Layout);
    jPanel6Layout.setHorizontalGroup(
        jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel6Layout.createSequentialGroup()
            .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                .addComponent(jButton19)
                .addComponent(jScrollPane13, javax.swing.GroupLayout.PREFERRED_SIZE, 364, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addGap(32, 32, 32)
                        .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel17)
                            .addComponent(jLabel16)
                            .addComponent(jLabel19)
                            .addComponent(jLabel20)))
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addGap(67, 67, 67)
                        .addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, 364, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addComponent(jButton18)
                        .addGap(89, 89, 89)
                        .addComponent(labelNPregERP)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jButton17))
                    .addComponent(jScrollPane12, javax.swing.GroupLayout.PREFERRED_SIZE, 364, javax.swing.GroupLayout.PREFERRED_SIZE)))
            .addContainerGap(86, Short.MAX_VALUE))
    );
    jPanel6Layout.setVerticalGroup(
        jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel6Layout.createSequentialGroup()
            .addGap(25, 25, 25)
            .addComponent(jLabel16)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
            .addComponent(jLabel17)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addGap(18, 18, 18)
            .addComponent(jLabel19)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jScrollPane13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addGap(24, 24, 24)
            .addComponent(jLabel20)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jScrollPane12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addGap(21, 21, 21)
            .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(labelNPregERP)
                .addComponent(jButton17)
                .addComponent(jButton18))
            .addGap(18, 18, 18)
            .addComponent(jButton19)
            .addContainerGap(56, Short.MAX_VALUE))
    );

    javax.swing.GroupLayout _examenResueltoPLayout = new javax.swing.GroupLayout(_examenResueltoP.getContentPane());
    _examenResueltoP.getContentPane().setLayout(_examenResueltoPLayout);
    _examenResueltoPLayout.setHorizontalGroup(
        _examenResueltoPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addComponent(jPanel6, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    );
    _examenResueltoPLayout.setVerticalGroup(
        _examenResueltoPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addComponent(jPanel6, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    );

    _verExamenesA.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    _verExamenesA.setMinimumSize(new java.awt.Dimension(460, 475));
    _verExamenesA.setResizable(false);
    _verExamenesA.setSize(new java.awt.Dimension(517, 475));

    volverVerExamenesA.setText("Volver");
    volverVerExamenesA.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            volverVerExamenesAActionPerformed(evt);
        }
    });

    tablaNotificacionesA.setModel(new javax.swing.table.DefaultTableModel(
        new Object [][] {

        },
        new String [] {
            "Examen", "Leída", "Fecha inicio", "Fecha fin", ""
        }
    ) {
        Class[] types = new Class [] {
            java.lang.String.class, java.lang.Boolean.class, java.lang.String.class, java.lang.String.class, java.lang.String.class
        };
        boolean[] canEdit = new boolean [] {
            false, false, false, false, false
        };

        public Class getColumnClass(int columnIndex) {
            return types [columnIndex];
        }

        public boolean isCellEditable(int rowIndex, int columnIndex) {
            return canEdit [columnIndex];
        }
    });
    tablaNotificacionesA.getTableHeader().setReorderingAllowed(false);
    tablaNotificacionesA.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            tablaNotificacionesAMouseClicked(evt);
        }
    });
    jScrollPane8.setViewportView(tablaNotificacionesA);
    tablaNotificacionesA.getColumnModel().getColumn(0).setResizable(false);
    tablaNotificacionesA.getColumnModel().getColumn(1).setResizable(false);
    tablaNotificacionesA.getColumnModel().getColumn(2).setResizable(false);
    tablaNotificacionesA.getColumnModel().getColumn(3).setResizable(false);
    tablaNotificacionesA.getColumnModel().getColumn(4).setResizable(false);

    hacerExamen.setText("Hacer examen");
    hacerExamen.setEnabled(false);
    hacerExamen.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            hacerExamenActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
    jPanel9.setLayout(jPanel9Layout);
    jPanel9Layout.setHorizontalGroup(
        jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel9Layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel9Layout.createSequentialGroup()
                    .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 375, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 0, Short.MAX_VALUE))
                .addGroup(jPanel9Layout.createSequentialGroup()
                    .addGap(0, 0, Short.MAX_VALUE)
                    .addComponent(hacerExamen)))
            .addContainerGap())
    );
    jPanel9Layout.setVerticalGroup(
        jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel9Layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 238, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addGap(18, 18, 18)
            .addComponent(hacerExamen)
            .addContainerGap(24, Short.MAX_VALUE))
    );

    jTabbedPane1.addTab("Notificaciones", jPanel9);

    tablaExamenesFinA.setModel(new javax.swing.table.DefaultTableModel(
        new Object [][] {

        },
        new String [] {
            "Examen", "Nota"
        }
    ) {
        Class[] types = new Class [] {
            java.lang.String.class, java.lang.String.class
        };
        boolean[] canEdit = new boolean [] {
            false, false
        };

        public Class getColumnClass(int columnIndex) {
            return types [columnIndex];
        }

        public boolean isCellEditable(int rowIndex, int columnIndex) {
            return canEdit [columnIndex];
        }
    });
    tablaExamenesFinA.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseClicked(java.awt.event.MouseEvent evt) {
            tablaExamenesFinAMouseClicked(evt);
        }
    });
    jScrollPane16.setViewportView(tablaExamenesFinA);
    tablaExamenesFinA.getColumnModel().getColumn(0).setResizable(false);
    tablaExamenesFinA.getColumnModel().getColumn(1).setResizable(false);

    verExamenA.setText("Ver examen");
    verExamenA.setEnabled(false);
    verExamenA.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            verExamenAActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
    jPanel10.setLayout(jPanel10Layout);
    jPanel10Layout.setHorizontalGroup(
        jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel10Layout.createSequentialGroup()
            .addContainerGap()
            .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel10Layout.createSequentialGroup()
                    .addComponent(jScrollPane16, javax.swing.GroupLayout.PREFERRED_SIZE, 375, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 0, Short.MAX_VALUE))
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup()
                    .addGap(0, 0, Short.MAX_VALUE)
                    .addComponent(verExamenA)))
            .addContainerGap())
    );
    jPanel10Layout.setVerticalGroup(
        jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel10Layout.createSequentialGroup()
            .addContainerGap()
            .addComponent(jScrollPane16, javax.swing.GroupLayout.PREFERRED_SIZE, 239, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 35, Short.MAX_VALUE)
            .addComponent(verExamenA)
            .addContainerGap())
    );

    jTabbedPane1.addTab("Exámenes", jPanel10);

    javax.swing.GroupLayout _verExamenesALayout = new javax.swing.GroupLayout(_verExamenesA.getContentPane());
    _verExamenesA.getContentPane().setLayout(_verExamenesALayout);
    _verExamenesALayout.setHorizontalGroup(
        _verExamenesALayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(_verExamenesALayout.createSequentialGroup()
            .addGap(40, 40, 40)
            .addGroup(_verExamenesALayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(volverVerExamenesA, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addContainerGap(12, Short.MAX_VALUE))
    );
    _verExamenesALayout.setVerticalGroup(
        _verExamenesALayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(_verExamenesALayout.createSequentialGroup()
            .addGap(34, 34, 34)
            .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 361, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
            .addComponent(volverVerExamenesA)
            .addContainerGap(39, Short.MAX_VALUE))
    );

    _examenResueltoA.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    _examenResueltoA.setResizable(false);
    _examenResueltoA.setSize(new java.awt.Dimension(517, 707));

    jButton20.setText(">");
    jButton20.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton20ActionPerformed(evt);
        }
    });

    preguntaERA.setColumns(20);
    preguntaERA.setEditable(false);
    preguntaERA.setRows(5);
    jScrollPane10.setViewportView(preguntaERA);

    jLabel18.setText("Nota: ");

    jLabel21.setText("Pregunta:");

    jLabel22.setText("Respuesta:");

    respuestaOkERA.setColumns(20);
    respuestaOkERA.setEditable(false);
    respuestaOkERA.setRows(5);
    jScrollPane14.setViewportView(respuestaOkERA);

    jLabel23.setText("Respuesta correcta:");

    respuestaAluERA.setBackground(new java.awt.Color(0, 153, 51));
    respuestaAluERA.setColumns(20);
    respuestaAluERA.setEditable(false);
    respuestaAluERA.setRows(5);
    jScrollPane15.setViewportView(respuestaAluERA);

    labelNPregERA.setText("01/10");

    jButton21.setText("<");
    jButton21.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton21ActionPerformed(evt);
        }
    });

    volverExamenResueltoA.setText("Volver");
    volverExamenResueltoA.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            volverExamenResueltoAActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
    jPanel8.setLayout(jPanel8Layout);
    jPanel8Layout.setHorizontalGroup(
        jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel8Layout.createSequentialGroup()
            .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                .addComponent(volverExamenResueltoA)
                .addComponent(jScrollPane15, javax.swing.GroupLayout.PREFERRED_SIZE, 364, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addGap(32, 32, 32)
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel21)
                            .addComponent(jLabel18)
                            .addComponent(jLabel22)
                            .addComponent(jLabel23)))
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addGap(67, 67, 67)
                        .addComponent(jScrollPane10, javax.swing.GroupLayout.PREFERRED_SIZE, 364, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addComponent(jButton21)
                        .addGap(89, 89, 89)
                        .addComponent(labelNPregERA)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jButton20))
                    .addComponent(jScrollPane14, javax.swing.GroupLayout.PREFERRED_SIZE, 364, javax.swing.GroupLayout.PREFERRED_SIZE)))
            .addContainerGap(86, Short.MAX_VALUE))
    );
    jPanel8Layout.setVerticalGroup(
        jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel8Layout.createSequentialGroup()
            .addGap(25, 25, 25)
            .addComponent(jLabel18)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
            .addComponent(jLabel21)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jScrollPane10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addGap(18, 18, 18)
            .addComponent(jLabel22)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jScrollPane15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addGap(24, 24, 24)
            .addComponent(jLabel23)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jScrollPane14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addGap(21, 21, 21)
            .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(labelNPregERA)
                .addComponent(jButton20)
                .addComponent(jButton21))
            .addGap(18, 18, 18)
            .addComponent(volverExamenResueltoA)
            .addContainerGap(56, Short.MAX_VALUE))
    );

    javax.swing.GroupLayout _examenResueltoALayout = new javax.swing.GroupLayout(_examenResueltoA.getContentPane());
    _examenResueltoA.getContentPane().setLayout(_examenResueltoALayout);
    _examenResueltoALayout.setHorizontalGroup(
        _examenResueltoALayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addComponent(jPanel8, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    );
    _examenResueltoALayout.setVerticalGroup(
        _examenResueltoALayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addComponent(jPanel8, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    );

    _verNotificacionesA.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    _verNotificacionesA.setMinimumSize(new java.awt.Dimension(460, 475));
    _verNotificacionesA.setResizable(false);
    _verNotificacionesA.setSize(new java.awt.Dimension(517, 475));

    tablaExamenesA1.setModel(new javax.swing.table.DefaultTableModel(
        new Object [][] {

        },
        new String [] {
            "Examen", "Nota"
        }
    ) {
        Class[] types = new Class [] {
            java.lang.String.class, java.lang.String.class
        };

        public Class getColumnClass(int columnIndex) {
            return types [columnIndex];
        }
    });
    jScrollPane11.setViewportView(tablaExamenesA1);

    volverVerExamenesA1.setText("Volver");
    volverVerExamenesA1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            volverVerExamenesA1ActionPerformed(evt);
        }
    });

    verExamenA1.setText("Ver examen");
    verExamenA1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            verExamenA1ActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout _verNotificacionesALayout = new javax.swing.GroupLayout(_verNotificacionesA.getContentPane());
    _verNotificacionesA.getContentPane().setLayout(_verNotificacionesALayout);
    _verNotificacionesALayout.setHorizontalGroup(
        _verNotificacionesALayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(_verNotificacionesALayout.createSequentialGroup()
            .addGap(40, 40, 40)
            .addGroup(_verNotificacionesALayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, 375, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, _verNotificacionesALayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(verExamenA1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(volverVerExamenesA1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
            .addContainerGap(45, Short.MAX_VALUE))
    );
    _verNotificacionesALayout.setVerticalGroup(
        _verNotificacionesALayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(_verNotificacionesALayout.createSequentialGroup()
            .addGap(61, 61, 61)
            .addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, 275, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addGap(18, 18, 18)
            .addComponent(verExamenA1)
            .addGap(24, 24, 24)
            .addComponent(volverVerExamenesA1)
            .addContainerGap(39, Short.MAX_VALUE))
    );

    _matricularA.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    _matricularA.setResizable(false);
    _matricularA.setSize(new java.awt.Dimension(517, 249));

    jPanel13.setMaximumSize(new java.awt.Dimension(517, 249));
    jPanel13.setSize(new java.awt.Dimension(517, 249));

    listaAsigMatricA.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            listaAsigMatricAActionPerformed(evt);
        }
    });

    jLabel25.setText("Asignatura");

    tablaAsigMatricA.setModel(new javax.swing.table.DefaultTableModel(
        new Object [][] {

        },
        new String [] {
            " Asignaturas matriculadas"
        }
    ) {
        Class[] types = new Class [] {
            java.lang.String.class
        };
        boolean[] canEdit = new boolean [] {
            false
        };

        public Class getColumnClass(int columnIndex) {
            return types [columnIndex];
        }

        public boolean isCellEditable(int rowIndex, int columnIndex) {
            return canEdit [columnIndex];
        }
    });
    tablaAsigMatricA.setFocusCycleRoot(true);
    tablaAsigMatricA.getTableHeader().setResizingAllowed(false);
    jScrollPane19.setViewportView(tablaAsigMatricA);

    matricButtonA.setText("Añadir");
    matricButtonA.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            matricButtonAActionPerformed(evt);
        }
    });

    atrasMatricA.setText("Atrás");
    atrasMatricA.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            atrasMatricAActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
    jPanel13.setLayout(jPanel13Layout);
    jPanel13Layout.setHorizontalGroup(
        jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel13Layout.createSequentialGroup()
            .addGap(54, 54, 54)
            .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel13Layout.createSequentialGroup()
                    .addComponent(matricButtonA)
                    .addGap(29, 29, 29)
                    .addComponent(atrasMatricA))
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel13Layout.createSequentialGroup()
                        .addComponent(jLabel25)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(listaAsigMatricA, javax.swing.GroupLayout.PREFERRED_SIZE, 293, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane19, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 396, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addComponent(jScrollPane19, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 396, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addContainerGap(67, Short.MAX_VALUE))
    );
    jPanel13Layout.setVerticalGroup(
        jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel13Layout.createSequentialGroup()
            .addGap(32, 32, 32)
            .addComponent(jScrollPane19, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 20, Short.MAX_VALUE)
            .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(listaAsigMatricA, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(jLabel25))
            .addGap(18, 18, 18)
            .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(matricButtonA)
                .addComponent(atrasMatricA))
            .addGap(24, 24, 24))
    );

    javax.swing.GroupLayout _matricularALayout = new javax.swing.GroupLayout(_matricularA.getContentPane());
    _matricularA.getContentPane().setLayout(_matricularALayout);
    _matricularALayout.setHorizontalGroup(
        _matricularALayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    );
    _matricularALayout.setVerticalGroup(
        _matricularALayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(_matricularALayout.createSequentialGroup()
            .addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addContainerGap())
    );

    _hacerExamen.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    _hacerExamen.setResizable(false);
    _hacerExamen.setSize(new java.awt.Dimension(517, 707));

    jButton22.setText(">");
    jButton22.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton22ActionPerformed(evt);
        }
    });

    preguntaHE.setColumns(20);
    preguntaHE.setEditable(false);
    preguntaHE.setRows(5);
    jScrollPane17.setViewportView(preguntaHE);

    jLabel26.setText("Pregunta:");

    jLabel27.setText("Respuestas:");

    labelNPregHE.setText("01/10");

    jButton23.setText("<");
    jButton23.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton23ActionPerformed(evt);
        }
    });

    terminarExamen.setText("Terminar");
    terminarExamen.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            terminarExamenActionPerformed(evt);
        }
    });

    tablaRespuestasHE.setModel(new javax.swing.table.DefaultTableModel(
        new Object [][] {

        },
        new String [] {
            " ", "Respuesta", "OK"
        }
    ) {
        Class[] types = new Class [] {
            java.lang.Integer.class, java.lang.String.class, java.lang.Boolean.class
        };
        boolean[] canEdit = new boolean [] {
            false, false, true
        };

        public Class getColumnClass(int columnIndex) {
            return types [columnIndex];
        }

        public boolean isCellEditable(int rowIndex, int columnIndex) {
            return canEdit [columnIndex];
        }
    });
    tablaRespuestasHE.setFocusCycleRoot(true);
    jScrollPane20.setViewportView(tablaRespuestasHE);

    javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
    jPanel11.setLayout(jPanel11Layout);
    jPanel11Layout.setHorizontalGroup(
        jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel11Layout.createSequentialGroup()
            .addGap(32, 32, 32)
            .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                .addComponent(terminarExamen)
                .addGroup(jPanel11Layout.createSequentialGroup()
                    .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel26)
                        .addComponent(jLabel27))
                    .addGap(331, 331, 331))
                .addGroup(jPanel11Layout.createSequentialGroup()
                    .addComponent(jButton23)
                    .addGap(89, 89, 89)
                    .addComponent(labelNPregHE)
                    .addGap(86, 86, 86)
                    .addComponent(jButton22)))
            .addContainerGap())
        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel11Layout.createSequentialGroup()
            .addGap(0, 50, Short.MAX_VALUE)
            .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                .addGroup(jPanel11Layout.createSequentialGroup()
                    .addGap(1, 1, 1)
                    .addComponent(jScrollPane20, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                .addComponent(jScrollPane17, javax.swing.GroupLayout.PREFERRED_SIZE, 410, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGap(57, 57, 57))
    );
    jPanel11Layout.setVerticalGroup(
        jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel11Layout.createSequentialGroup()
            .addGap(31, 31, 31)
            .addComponent(jLabel26)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addComponent(jScrollPane17, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addGap(40, 40, 40)
            .addComponent(jLabel27)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
            .addComponent(jScrollPane20, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addGap(136, 136, 136)
            .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(labelNPregHE)
                .addComponent(jButton22)
                .addComponent(jButton23))
            .addGap(18, 18, 18)
            .addComponent(terminarExamen)
            .addContainerGap(56, Short.MAX_VALUE))
    );

    javax.swing.GroupLayout _hacerExamenLayout = new javax.swing.GroupLayout(_hacerExamen.getContentPane());
    _hacerExamen.getContentPane().setLayout(_hacerExamenLayout);
    _hacerExamenLayout.setHorizontalGroup(
        _hacerExamenLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addComponent(jPanel11, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    );
    _hacerExamenLayout.setVerticalGroup(
        _hacerExamenLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addComponent(jPanel11, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    );

    _matricularP.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    _matricularP.setResizable(false);
    _matricularP.setSize(new java.awt.Dimension(517, 249));

    jPanel14.setMaximumSize(new java.awt.Dimension(517, 249));
    jPanel14.setSize(new java.awt.Dimension(517, 249));

    listaAsigMatricP.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            listaAsigMatricPActionPerformed(evt);
        }
    });

    jLabel28.setText("Asignatura");

    tablaAsigMatricP.setModel(new javax.swing.table.DefaultTableModel(
        new Object [][] {

        },
        new String [] {
            " Asignaturas matriculadas"
        }
    ) {
        Class[] types = new Class [] {
            java.lang.String.class
        };
        boolean[] canEdit = new boolean [] {
            false
        };

        public Class getColumnClass(int columnIndex) {
            return types [columnIndex];
        }

        public boolean isCellEditable(int rowIndex, int columnIndex) {
            return canEdit [columnIndex];
        }
    });
    tablaAsigMatricP.setFocusCycleRoot(true);
    tablaAsigMatricP.getTableHeader().setResizingAllowed(false);
    jScrollPane21.setViewportView(tablaAsigMatricP);

    matricButtonP.setText("Añadir");
    matricButtonP.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            matricButtonPActionPerformed(evt);
        }
    });

    atrasMatricP.setText("Atrás");
    atrasMatricP.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            atrasMatricPActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
    jPanel14.setLayout(jPanel14Layout);
    jPanel14Layout.setHorizontalGroup(
        jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel14Layout.createSequentialGroup()
            .addGap(54, 54, 54)
            .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel14Layout.createSequentialGroup()
                    .addComponent(matricButtonP)
                    .addGap(29, 29, 29)
                    .addComponent(atrasMatricP))
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel14Layout.createSequentialGroup()
                        .addComponent(jLabel28)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(listaAsigMatricP, javax.swing.GroupLayout.PREFERRED_SIZE, 293, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane21, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 396, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addComponent(jScrollPane21, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 396, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addContainerGap(67, Short.MAX_VALUE))
    );
    jPanel14Layout.setVerticalGroup(
        jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(jPanel14Layout.createSequentialGroup()
            .addGap(32, 32, 32)
            .addComponent(jScrollPane21, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 20, Short.MAX_VALUE)
            .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(listaAsigMatricP, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(jLabel28))
            .addGap(18, 18, 18)
            .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(matricButtonP)
                .addComponent(atrasMatricP))
            .addGap(24, 24, 24))
    );

    javax.swing.GroupLayout _matricularPLayout = new javax.swing.GroupLayout(_matricularP.getContentPane());
    _matricularP.getContentPane().setLayout(_matricularPLayout);
    _matricularPLayout.setHorizontalGroup(
        _matricularPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addComponent(jPanel14, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    );
    _matricularPLayout.setVerticalGroup(
        _matricularPLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(_matricularPLayout.createSequentialGroup()
            .addComponent(jPanel14, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addContainerGap())
    );

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setTitle("Cliente de aula virtual");
    setName("loginFrame");

    _usuarioLabel.setText("Usuario:");

    _passwordLabel.setText("Contraseña:");

    _userInput.setToolTipText("");

    _loginButton.setText("Identificarse");
    _loginButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            _loginButtonActionPerformed(evt);
        }
    });

    _incorrectLoginLabel.setForeground(new java.awt.Color(255, 0, 0));
    _incorrectLoginLabel.setText("Credenciales incorrectos");
    _incorrectLoginLabel.setName("");

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
            .addContainerGap(329, Short.MAX_VALUE)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                .addComponent(_incorrectLoginLabel)
                .addGroup(layout.createSequentialGroup()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(_passwordLabel)
                        .addComponent(_usuarioLabel))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(_loginButton)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(_userInput)
                            .addComponent(_passwordInput, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE)))))
            .addGap(35, 35, 35))
    );
    layout.setVerticalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
            .addContainerGap(315, Short.MAX_VALUE)
            .addComponent(_incorrectLoginLabel)
            .addGap(18, 18, 18)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(_usuarioLabel)
                .addComponent(_userInput, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(_passwordLabel)
                .addComponent(_passwordInput, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
            .addComponent(_loginButton)
            .addContainerGap())
    );

    pack();
    }// </editor-fold>//GEN-END:initComponents

    private void _loginButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event__loginButtonActionPerformed
		int login = cliente.login(this._userInput.getText(), this._passwordInput.getPassword());
		//Si el login es incorrecto mostramos un mensaje
		System.out.println(login);
		if (login == -1) {
			this._incorrectLoginLabel.setVisible(true);
		} //Si el login es correcto y el usuario es un profesor mostramos la interfaz de profesor
		else if (login == 0) {
			_ventanaPrincipalP.setVisible(true);
			_ventanaPrincipalP.pack();
			this.setVisible(false);

		} //Si el login es correcto y el usuario es un profesor mostramos la interfaz de alumno
		else {
			_ventanaPrincipalA.setVisible(true);
			_ventanaPrincipalA.pack();
			PaqueteCORBA.InfoNotificacionExamen[] in = cliente.getNotificaciones();
			int notificacionesNuevas = 0;
			for (int i = 0; i < in.length; i++) {
				if (!in[i].leido) {
					notificacionesNuevas++;
				}
			}
			verNotificacionesBotonVPA.setText("Ver notificaciones (" + Integer.toString(notificacionesNuevas) + ")");
			this.setVisible(false);

		}
    }//GEN-LAST:event__loginButtonActionPerformed

    private void salirVPPActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_salirVPPActionPerformed
		System.exit(0);
    }//GEN-LAST:event_salirVPPActionPerformed

    private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
		_anyadirPreguntaP.setVisible(false);
		_ventanaPrincipalP.setVisible(true);

		enunciadoNuevaPregunta.setText("");
		enunciadoNuevaRespuesta.setText("");
		okRespuestaAP.setSelected(false);
		preguntaAnyadida = false;
		listaAsignaturasAPP.setEnabled(true);
		listaTemasAPP.setEnabled(true);
		DefaultTableModel model = (DefaultTableModel) tablaRespuestasAP.getModel();
		while (model.getRowCount() > 0) {
			model.removeRow(0);
		}
    }//GEN-LAST:event_jButton7ActionPerformed

    private void listaAsignaturasAPPActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_listaAsignaturasAPPActionPerformed
		if (listaAsignaturasAPP.getItemCount() > 0) {
			try {
				String temas[] = cliente.getTemasAsignatura((String) listaAsignaturasAPP.getSelectedItem());
				listaTemasAPP.removeAllItems();
				for (int i = 0; i < temas.length; i++) {
					listaTemasAPP.addItem(temas[i]);
				}
			} catch (excepcion e) {
				JOptionPane.showMessageDialog(null, e.msg, "Error", JOptionPane.ERROR_MESSAGE);
			}
		}
    }//GEN-LAST:event_listaAsignaturasAPPActionPerformed

	private void anyadirPregunta() {
		String enunciado = enunciadoNuevaPregunta.getText();
		String idAsig = (String) listaAsignaturasAPP.getSelectedItem();
		String idTema = (String) listaTemasAPP.getSelectedItem();
		System.out.println(enunciado + " " + idAsig + " " + idTema);
		cliente.anyadirPregunta(idAsig, idTema, enunciado);
		enunciadoNuevaPregunta.setEnabled(false);
	}
    private void listaExamenesVEActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_listaExamenesVEActionPerformed
	if (listaExamenesVE.getItemCount() > 0) {	
            verExamenVEP.setEnabled(false);

            String examen = (String) listaExamenesVE.getSelectedItem();

            PaqueteCORBA.InfoExamen[] notas = cliente.getNotasExamen(examen);

            DefaultTableModel model = (DefaultTableModel) tablaExamenesVE.getModel();
            model.setRowCount(0);

            for (int i = 0; i < notas.length; i++) {
                    model.addRow(new Object[]{notas[i].nombre, notas[i].nota});
            }
        }
    }//GEN-LAST:event_listaExamenesVEActionPerformed

    private void volverVEPActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_volverVEPActionPerformed
		// TODO add your handling code here:
		_verExamenesP.setVisible(false);
		_ventanaPrincipalP.setVisible(true);
    }//GEN-LAST:event_volverVEPActionPerformed

    private void jButton17ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton17ActionPerformed
		// TODO add your handling code here:                 
		String respsA = new String("");
		String respsOk = new String("");
		String label = new String("");

		preguntaERP.setText(ee.preguntas[nPreg].enunciadoPregunta);
		nPreg = (nPreg + 1) % ee.preguntas.length;

		respuestaAluERP.setText("");
		respuestaAluERP.setText("");

		for (int i = 0; i < ee.preguntas[nPreg].respuestas.length; i++) {
			if (ee.preguntas[nPreg].respuestas[i].correcta) {
				respsOk += ee.preguntas[nPreg].respuestas[i].respuesta + "\n";
			}
		}

		for (int i = 0; i < ee.preguntas[nPreg].respuestas.length; i++) {
			if (ee.preguntas[nPreg].respuestas[i].marcada) {
				respsA += ee.preguntas[nPreg].respuestas[i].respuesta + "\n";
			}
		}

		respuestaOkERP.setText(respsOk);
		respuestaAluERP.setText(respsA);

		label = (nPreg + 1) + "/" + ee.preguntas.length;
		labelNPregERP.setText(label);
		if (respsOk.equals(respsA)) {
			respuestaAluERP.setBackground(Color.GREEN);
		} else {
			respuestaAluERP.setBackground(Color.RED);
		}


    }//GEN-LAST:event_jButton17ActionPerformed

    private void jButton18ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton18ActionPerformed
		String respsA = new String("");
		String respsOk = new String("");
		String label = new String("");

		preguntaERP.setText(ee.preguntas[nPreg].enunciadoPregunta);
		nPreg = (nPreg - 1);
		if (nPreg < 0) {
			nPreg = ee.preguntas.length - 1;
		}

		respuestaAluERP.setText("");
		respuestaAluERP.setText("");

		for (int i = 0; i < ee.preguntas[nPreg].respuestas.length; i++) {
			if (ee.preguntas[nPreg].respuestas[i].correcta) {
				respsOk += ee.preguntas[nPreg].respuestas[i].respuesta + "\n";
			}
		}

		for (int i = 0; i < ee.preguntas[nPreg].respuestas.length; i++) {
			if (ee.preguntas[nPreg].respuestas[i].marcada) {
				respsA += ee.preguntas[nPreg].respuestas[i].respuesta + "\n";
			}
		}

		respuestaOkERP.setText(respsOk);
		respuestaAluERP.setText(respsA);

		label = (nPreg + 1) + "/" + ee.preguntas.length;
		labelNPregERP.setText(label);
		if (respsOk.equals(respsA)) {
			respuestaAluERP.setBackground(Color.GREEN);
		} else {
			respuestaAluERP.setBackground(Color.RED);
		}
    }//GEN-LAST:event_jButton18ActionPerformed

    private void jButton19ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton19ActionPerformed
		_verExamenesP.setVisible(true);
		_examenResueltoP.setVisible(false);
    }//GEN-LAST:event_jButton19ActionPerformed

    private void verExamenVEPActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_verExamenVEPActionPerformed
		// TODO add your handling code here:

		_verExamenesP.setVisible(false);
		_examenResueltoP.setVisible(true);
		String idAlumno = (String) tablaExamenesVE.getValueAt(tablaExamenesVE.getSelectedRow(), 0);
		String idExamen = (String) listaExamenesVE.getSelectedItem();
		String respsA = new String("");
		String respsOk = new String("");
		String label = new String("");

		ee = cliente.getInfoExamenEspecifico(idAlumno, idExamen);

		nPreg = 0;
		preguntaERP.setText(ee.preguntas[nPreg].enunciadoPregunta);

		respuestaAluERP.setText("");
		respuestaAluERP.setText("");

		for (int i = 0; i < ee.preguntas[nPreg].respuestas.length; i++) {
			if (ee.preguntas[nPreg].respuestas[i].correcta) {
				respsOk += ee.preguntas[nPreg].respuestas[i].respuesta + "\n";
			}
		}

		for (int i = 0; i < ee.preguntas[nPreg].respuestas.length; i++) {
			if (ee.preguntas[nPreg].respuestas[i].marcada) {
				respsA += ee.preguntas[nPreg].respuestas[i].respuesta + "\n";
			}
		}

		respuestaOkERP.setText(respsOk);
		respuestaAluERP.setText(respsA);

		label = "1/" + ee.preguntas.length;
		labelNPregERP.setText(label);
		if (respsOk.equals(respsA)) {
			respuestaAluERP.setBackground(Color.GREEN);
		} else {
			respuestaAluERP.setBackground(Color.RED);
		}
    }//GEN-LAST:event_verExamenVEPActionPerformed

    private void verExamenesVPPActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_verExamenesVPPActionPerformed
		// TODO add your handling code here:
		_ventanaPrincipalP.setVisible(false);
		_verExamenesP.setVisible(true);
                listaExamenesVE.removeAllItems();
		String[] examenes = cliente.getExamenes();

		for (int i = 0; i < examenes.length; i++) {
			listaExamenesVE.addItem(examenes[i]);
		}
		PaqueteCORBA.InfoExamen[] notas = cliente.getNotasExamen(examenes[0]);

		tablaExamenesVE.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
		TableColumnModel tcmTrAp = tablaExamenesVE.getColumnModel();
		tcmTrAp.getColumn(0).setPreferredWidth(319);
		tcmTrAp.getColumn(1).setPreferredWidth(50);

		DefaultTableModel model = (DefaultTableModel) tablaExamenesVE.getModel();
		model.setRowCount(0);
		for (int i = 0; i < notas.length; i++) {
			model.addRow(new Object[]{notas[i].nombre, notas[i].nota});
		}
    }//GEN-LAST:event_verExamenesVPPActionPerformed

    private void anyadirPreguntaVPPActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_anyadirPreguntaVPPActionPerformed
		String[] asignaturas;
		String[] temas;

		try {
			asignaturas = cliente.getAsignaturasMatriculadas();
			temas = cliente.getTemasAsignatura(asignaturas[0]);
			_ventanaPrincipalP.setVisible(false);
			_anyadirPreguntaP.setVisible(true);
			enunciadoNuevaPregunta.setEnabled(true);
			//La lista que se devuelve está declarada como private en Cliente?
			//asignaturasImpartidas = getAsignaturasDeUnProfesor();

			listaAsignaturasAPP.removeAllItems();
			for (int i = 0; i < asignaturas.length; i++) {
				listaAsignaturasAPP.addItem(asignaturas[i]);
			}

			listaTemasAPP.removeAllItems();
			for (int i = 0; i < temas.length; i++) {
				listaTemasAPP.addItem(temas[i]);
			}

			tablaRespuestasAP.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
			TableColumnModel tcmTrAp = tablaRespuestasAP.getColumnModel();
			tcmTrAp.getColumn(0).setPreferredWidth(50);
			tcmTrAp.getColumn(1).setPreferredWidth(270);
			tcmTrAp.getColumn(2).setPreferredWidth(50);
		} catch (excepcion e) {
			JOptionPane.showMessageDialog(null, e.msg, "Error", JOptionPane.ERROR_MESSAGE);
		}

    }//GEN-LAST:event_anyadirPreguntaVPPActionPerformed

    private void verExamenesAActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_verExamenesAActionPerformed
		_ventanaPrincipalA.setVisible(false);
		_verExamenesA.setVisible(true);
		jTabbedPane1.setSelectedIndex(1);
		mostrarNotificaciones();
    }//GEN-LAST:event_verExamenesAActionPerformed

	private void mostrarNotificaciones() {
		tablaNotificacionesA.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
		TableColumnModel tcmTrAp = tablaNotificacionesA.getColumnModel();
		tcmTrAp.getColumn(0).setPreferredWidth(300);
		tcmTrAp.getColumn(1).setPreferredWidth(50);
		tcmTrAp.getColumn(2).setPreferredWidth(150);
		tcmTrAp.getColumn(3).setPreferredWidth(150);
		tcmTrAp.getColumn(4).setPreferredWidth(50);

		tablaExamenesFinA.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
		TableColumnModel tcmTrAp2 = tablaExamenesFinA.getColumnModel();
		tcmTrAp2.getColumn(0).setPreferredWidth(250);
		tcmTrAp2.getColumn(1).setPreferredWidth(100);

		PaqueteCORBA.InfoExamen[] ie = cliente.getExamenesAlumno();
		PaqueteCORBA.InfoNotificacionExamen[] in = cliente.getNotificaciones();
		int notificacionesNuevas = 0;
		for (int i = 0; i < in.length; i++) {
			if (!in[i].leido) {
				notificacionesNuevas++;
			}
		}
		verNotificacionesBotonVPA.setText("Ver notificaciones (" + Integer.toString(notificacionesNuevas) + ")");		

		//Tabla de notificaciones de exámenes            	
		DefaultTableModel modelN = (DefaultTableModel) tablaNotificacionesA.getModel();

		while (modelN.getRowCount() > 0) {
			modelN.removeRow(0);
		}

		for (int i = 0; i < in.length; i++) {
                    if(!in[i].corregido){
			modelN.addRow(new Object[]{in[i].idExamen, in[i].leido, in[i].fechaIni, in[i].fechaFin, in[i].idNotificacion});
                    }
                    else{                        
                        modelN.addRow(new Object[]{in[i].idExamen.concat(" (CORREGIDO)"), in[i].leido, in[i].fechaIni, in[i].fechaFin, in[i].idNotificacion});
                    }
		}

		//Tabla de exámenes pendientes
		DefaultTableModel model = (DefaultTableModel) tablaExamenesFinA.getModel();
		while (model.getRowCount() > 0) {
			model.removeRow(0);
		}
		for (int i = 0; i < ie.length; i++) {
			model.addRow(new Object[]{ie[i].idExamen, ie[i].nota});
		}

	}
    private void volverVerExamenesAActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_volverVerExamenesAActionPerformed
		_verExamenesA.setVisible(false);
		_ventanaPrincipalA.setVisible(true);
		PaqueteCORBA.InfoNotificacionExamen[] in = cliente.getNotificaciones();
		int notificacionesNuevas = 0;
		for (int i = 0; i < in.length; i++) {
			if (!in[i].leido) {
				notificacionesNuevas++;
			}
		}
		verNotificacionesBotonVPA.setText("Ver notificaciones (" + Integer.toString(notificacionesNuevas) + ")");
    }//GEN-LAST:event_volverVerExamenesAActionPerformed

    private void verExamenAActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_verExamenAActionPerformed

		if (!tablaExamenesFinA.getValueAt(tablaExamenesFinA.getSelectedRow(), 1).equals("NP")) {
			_examenResueltoA.setVisible(true);
			_verExamenesA.setVisible(false);

			String idExamen = (String) tablaExamenesFinA.getValueAt(tablaExamenesFinA.getSelectedRow(), 0);
			String respsA = new String("");
			String respsOk = new String("");
			String label = new String("");

			ee = cliente.getInfoExamenEspecificoAlumno(idExamen);

			nPreg = 0;
			preguntaERA.setText(ee.preguntas[nPreg].enunciadoPregunta);
			respuestaOkERA.setText("");
			respuestaAluERA.setText("");

			for (int i = 0; i < ee.preguntas[nPreg].respuestas.length; i++) {
				if (ee.preguntas[nPreg].respuestas[i].correcta) {
					respsOk += ee.preguntas[nPreg].respuestas[i].respuesta + "\n";
				}
			}

			for (int i = 0; i < ee.preguntas[nPreg].respuestas.length; i++) {
				if (ee.preguntas[nPreg].respuestas[i].marcada) {
					respsA += ee.preguntas[nPreg].respuestas[i].respuesta + "\n";
				}
			}

			respuestaOkERA.setText(respsOk);
			respuestaAluERA.setText(respsA);

			label = "1/" + ee.preguntas.length;
			labelNPregERA.setText(label);
			if (respsOk.equals(respsA)) {
				respuestaAluERA.setBackground(Color.GREEN);
			} else {
				respuestaAluERA.setBackground(Color.RED);
			}
		}
    }//GEN-LAST:event_verExamenAActionPerformed

    private void jButton20ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton20ActionPerformed
		String respsA = new String("");
		String respsOk = new String("");
		String label = new String("");

		nPreg = (nPreg + 1) % ee.preguntas.length;
		preguntaERA.setText(ee.preguntas[nPreg].enunciadoPregunta);
		respuestaOkERA.setText("");
		respuestaAluERA.setText("");

		for (int i = 0; i < ee.preguntas[nPreg].respuestas.length; i++) {
			if (ee.preguntas[nPreg].respuestas[i].correcta) {
				respsOk += ee.preguntas[nPreg].respuestas[i].respuesta + "\n";
			}
		}

		for (int i = 0; i < ee.preguntas[nPreg].respuestas.length; i++) {
			if (ee.preguntas[nPreg].respuestas[i].marcada) {
				respsA += ee.preguntas[nPreg].respuestas[i].respuesta + "\n";
			}
		}

		respuestaOkERA.setText(respsOk);
		respuestaAluERA.setText(respsA);

		label = (nPreg + 1) + "/" + ee.preguntas.length;
		labelNPregERA.setText(label);
		if (respsOk.equals(respsA)) {
			respuestaAluERA.setBackground(Color.GREEN);
		} else {
			respuestaAluERA.setBackground(Color.RED);
		}
    }//GEN-LAST:event_jButton20ActionPerformed

    private void jButton21ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton21ActionPerformed
		String respsA = new String("");
		String respsOk = new String("");
		String label = new String("");

		nPreg--;
		if (nPreg < 0) {
			nPreg = ee.preguntas.length - 1;
		}
		preguntaERA.setText(ee.preguntas[nPreg].enunciadoPregunta);
		respuestaOkERA.setText("");
		respuestaAluERA.setText("");

		for (int i = 0; i < ee.preguntas[nPreg].respuestas.length; i++) {
			if (ee.preguntas[nPreg].respuestas[i].correcta) {
				respsOk += ee.preguntas[nPreg].respuestas[i].respuesta + "\n";
			}
		}

		for (int i = 0; i < ee.preguntas[nPreg].respuestas.length; i++) {
			if (ee.preguntas[nPreg].respuestas[i].marcada) {
				respsA += ee.preguntas[nPreg].respuestas[i].respuesta + "\n";
			}
		}

		respuestaOkERA.setText(respsOk);
		respuestaAluERA.setText(respsA);

		label = (nPreg + 1) + "/" + ee.preguntas.length;
		labelNPregERA.setText(label);
		if (respsOk.equals(respsA)) {
			respuestaAluERA.setBackground(Color.GREEN);
		} else {
			respuestaAluERA.setBackground(Color.RED);
		}
    }//GEN-LAST:event_jButton21ActionPerformed

    private void volverExamenResueltoAActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_volverExamenResueltoAActionPerformed
		// TODO add your handling code here:
		_examenResueltoA.setVisible(false);
		_verExamenesA.setVisible(true);
    }//GEN-LAST:event_volverExamenResueltoAActionPerformed

    private void volverVerExamenesA1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_volverVerExamenesA1ActionPerformed
		// TODO add your handling code here:
    }//GEN-LAST:event_volverVerExamenesA1ActionPerformed

    private void verExamenA1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_verExamenA1ActionPerformed
		// TODO add your handling code here:
    }//GEN-LAST:event_verExamenA1ActionPerformed

    private void hacerExamenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_hacerExamenActionPerformed


		try {
			idExamenR = (String) tablaNotificacionesA.getValueAt(tablaNotificacionesA.getSelectedRow(), 0);
			ieeA = cliente.generarExamen(idExamenR);


			_hacerExamen.setVisible(true);
			_verExamenesA.setVisible(false);

			nPregAlu = 0;

			tablaRespuestasHE.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
			TableColumnModel tcmTrAp = tablaRespuestasHE.getColumnModel();
			tcmTrAp.getColumn(0).setPreferredWidth(50);
			tcmTrAp.getColumn(1).setPreferredWidth(270);
			tcmTrAp.getColumn(2).setPreferredWidth(65);

			preguntaHE.setText(ieeA.preguntas[nPregAlu].enunciadoPregunta);

			DefaultTableModel model = (DefaultTableModel) tablaRespuestasHE.getModel();
			for (int i = 0; i < ieeA.preguntas[nPregAlu].respuestas.length; i++) {
				model.addRow(new Object[]{i + 1, ieeA.preguntas[nPregAlu].respuestas[i].respuesta, ieeA.preguntas[nPregAlu].respuestas[i].marcada});
			}

			labelNPregHE.setText((nPregAlu + 1) + "/" + ieeA.preguntas.length);
		} catch (excepcion e) {
			JOptionPane.showMessageDialog(null, e.msg, "Error", JOptionPane.ERROR_MESSAGE);
		}

    }//GEN-LAST:event_hacerExamenActionPerformed

    private void jButton22ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton22ActionPerformed
		DefaultTableModel model = (DefaultTableModel) tablaRespuestasHE.getModel();

		//Guardamos las respuestas marcadas por el alumno antes de mostrar la siguiente pregunta
		for (int i = 0; i < ieeA.preguntas[nPregAlu].respuestas.length; i++) {
			ieeA.preguntas[nPregAlu].respuestas[i].marcada = (Boolean) model.getValueAt(i, 2);
		}
		while (model.getRowCount() > 0) {
			model.removeRow(0);
		}

		nPregAlu = (nPregAlu + 1) % (ieeA.preguntas.length);

		preguntaHE.setText(ieeA.preguntas[nPregAlu].enunciadoPregunta);
		for (int i = 0; i < ieeA.preguntas[nPregAlu].respuestas.length; i++) {
			model.addRow(new Object[]{i + 1, ieeA.preguntas[nPregAlu].respuestas[i].respuesta, ieeA.preguntas[nPregAlu].respuestas[i].marcada});
		}

		labelNPregHE.setText((nPregAlu + 1) + "/" + ieeA.preguntas.length);
    }//GEN-LAST:event_jButton22ActionPerformed

    private void jButton23ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton23ActionPerformed
		DefaultTableModel model = (DefaultTableModel) tablaRespuestasHE.getModel();

		while (model.getRowCount() > 0) {
			model.removeRow(0);
		}

		nPregAlu--;
		if (nPregAlu < 0) {
			nPregAlu = ieeA.preguntas.length - 1;
		}

		preguntaHE.setText(ieeA.preguntas[nPregAlu].enunciadoPregunta);
		for (int i = 0; i < ieeA.preguntas[nPregAlu].respuestas.length; i++) {
			model.addRow(new Object[]{i + 1, ieeA.preguntas[nPregAlu].respuestas[i].respuesta, ieeA.preguntas[nPregAlu].respuestas[i].marcada});
		}

		labelNPregHE.setText((nPregAlu + 1) + "/" + ieeA.preguntas.length);
    }//GEN-LAST:event_jButton23ActionPerformed

    private void terminarExamenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_terminarExamenActionPerformed
		_hacerExamen.setVisible(false);
		_verExamenesA.setVisible(true);
                hacerExamen.setEnabled(false);
		//Guardamos las respuestas marcadas por el alumno en la última ventana para enviar los cambios
		DefaultTableModel model = (DefaultTableModel) tablaRespuestasHE.getModel();
		for (int i = 0; i < ieeA.preguntas[nPregAlu].respuestas.length; i++) {
			ieeA.preguntas[nPregAlu].respuestas[i].marcada = (Boolean) model.getValueAt(i, 2);
		}
		cliente.enviarExamenEspecificoResulto(idExamenR, ieeA);
    }//GEN-LAST:event_terminarExamenActionPerformed

    private void tablaExamenesVEMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tablaExamenesVEMouseClicked

		verExamenVEP.setEnabled(true);
    }//GEN-LAST:event_tablaExamenesVEMouseClicked

    private void ponerExamenVPPActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ponerExamenVPPActionPerformed

		String[] asignaturas;
		String[] temas;
		aceptarBotonPEP.setEnabled(false);
		listaTemasPE.setEnabled(true);
		anyadirBotonPE.setEnabled(true);

		try {
			asignaturas = cliente.getAsignaturasMatriculadas();
			temas = cliente.getTemasAsignatura(asignaturas[0]);

			_ponerExamen.setVisible(true);
			_ventanaPrincipalP.setVisible(false);
			nPregsPE.setText("");
			DefaultTableModel model = (DefaultTableModel) tablaTemasPE.getModel();
			for (int i = 0; i < model.getRowCount(); i++) {
				model.removeRow(i);
			}

			listaAsignaturasPE.removeAllItems();

			for (int i = 0; i < asignaturas.length; i++) {
				listaAsignaturasPE.addItem(asignaturas[i]);
			}

			listaTemasPE.removeAllItems();
			for (int i = 0; i < temas.length; i++) {
				listaTemasPE.addItem(temas[i]);
			}

			tablaTemasPE.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
			TableColumnModel tcmTrAp = tablaTemasPE.getColumnModel();
			tcmTrAp.getColumn(0).setPreferredWidth(320);
			tcmTrAp.getColumn(1).setPreferredWidth(100);

			DefaultTableModel model2 = (DefaultTableModel) tablaTemasPE.getModel();
			while (model2.getRowCount() > 0) {
				model2.removeRow(0);
			}

			Calendar manyana = Calendar.getInstance();
			manyana.set(Calendar.DATE, Calendar.DATE);
			dateFechaFin.setSelectedDate(manyana);

		} catch (excepcion e) {
			JOptionPane.showMessageDialog(null, e.msg, "Error", JOptionPane.ERROR_MESSAGE);
		}
    }//GEN-LAST:event_ponerExamenVPPActionPerformed

    private void listaAsignaturasPEActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_listaAsignaturasPEActionPerformed
		try {
			if (listaAsignaturasPE.getSelectedIndex() >= 0) {
				String temas[] = cliente.getTemasAsignatura((String) listaAsignaturasPE.getSelectedItem());
				listaTemasPE.removeAllItems();
				for (int i = 0; i < temas.length; i++) {
					listaTemasPE.addItem(temas[i]);
				}
			}
		} catch (excepcion e) {
			JOptionPane.showMessageDialog(null, e.msg, "Error", JOptionPane.ERROR_MESSAGE);
		}
    }//GEN-LAST:event_listaAsignaturasPEActionPerformed

    private void nPregsPEKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_nPregsPEKeyTyped
		if (nPregsPE.getText().length() == limitePregsTA) {
			evt.consume();
		}
    }//GEN-LAST:event_nPregsPEKeyTyped

    private void anyadirBotonPEActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_anyadirBotonPEActionPerformed
		try {
			int np = Integer.parseInt(nPregsPE.getText());
			if (np == 0) {
				throw new NumberFormatException();
			}
			if (listaTemasPE.getSelectedIndex() == -1) {
				anyadirBotonPE.setEnabled(false);
				listaTemasPE.setEnabled(false);
			} else {
				String tema = (String) listaTemasPE.getSelectedItem();
				listaTemasPE.removeItemAt(listaTemasPE.getSelectedIndex());
				listaAsignaturasPE.setEnabled(false);
				DefaultTableModel model = (DefaultTableModel) tablaTemasPE.getModel();
				model.addRow(new Object[]{tema, np});
			}
			aceptarBotonPEP.setEnabled(true);
		} catch (NumberFormatException e) {
			nPregsPE.setText("");

		}
    }//GEN-LAST:event_anyadirBotonPEActionPerformed

    private void aceptarBotonPEPActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aceptarBotonPEPActionPerformed
		int maxPreg = tablaTemasPE.getRowCount();
		if (maxPreg > 0) {
			String asig = "";
			PaqueteCORBA.InfoTema[] temas = new PaqueteCORBA.InfoTema[maxPreg];
			String fechaIni = "";
			String fechaFin = "";

			asig = (String) listaAsignaturasPE.getSelectedItem();
			fechaIni = dateFechaInicio.getText();
			fechaFin = dateFechaFin.getText();

			for (int i = 0; i < tablaTemasPE.getRowCount(); i++) {
				String tema = (String) tablaTemasPE.getValueAt(i, 0);
				Integer np = (Integer) tablaTemasPE.getValueAt(i, 1);
				temas[i] = new PaqueteCORBA.InfoTema(tema, np.intValue());
			}
			try {
				cliente.ponerExamen(asig, temas, fechaIni, fechaFin);
			} catch (excepcion ex) {
				JOptionPane.showMessageDialog(null, ex.msg, "Error", JOptionPane.ERROR_MESSAGE);
			}

			_ventanaPrincipalP.setVisible(true);
			_ponerExamen.setVisible(false);
			listaAsignaturasPE.setEnabled(true);
			listaAsignaturasPE.setSelectedIndex(0);
		}
    }//GEN-LAST:event_aceptarBotonPEPActionPerformed

    private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton10ActionPerformed
		_ventanaPrincipalP.setVisible(true);
		_ponerExamen.setVisible(false);
    }//GEN-LAST:event_jButton10ActionPerformed

    private void tablaNotificacionesAMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tablaNotificacionesAMouseClicked
        String examen = (String)tablaNotificacionesA.getValueAt(tablaNotificacionesA.getSelectedRow(), 0);	
        String idNotificacion = (String) tablaNotificacionesA.getValueAt(tablaNotificacionesA.getSelectedRow(), 4);            
        tablaNotificacionesA.setValueAt((Boolean) true, tablaNotificacionesA.getSelectedRow(), 1);
        cliente.setNoficacionLeida(idNotificacion);        
        if(!examen.endsWith("(CORREGIDO)")){
            hacerExamen.setEnabled(true);
            
            
        }
    }//GEN-LAST:event_tablaNotificacionesAMouseClicked

    private void tablaExamenesFinAMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tablaExamenesFinAMouseClicked
		verExamenA.setEnabled(true);
    }//GEN-LAST:event_tablaExamenesFinAMouseClicked

    private void salirVPP1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_salirVPP1ActionPerformed
		// TODO add your handling code here:
		cliente.desconectar();
		System.exit(0);
    }//GEN-LAST:event_salirVPP1ActionPerformed

    private void matricularseAActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_matricularseAActionPerformed
		String[] asignaturasMatriculadas = null;
		String[] asignaturasPendientes = null;

		try {
			asignaturasMatriculadas = cliente.getAsignaturasMatriculadas();
			asignaturasPendientes = cliente.getAsignaturas();
		} catch (excepcion e) {
			//No pasa nada si el usuario no está matriculado en ninguna asignatura
			asignaturasMatriculadas = new String[0];
			asignaturasPendientes = cliente.getAsignaturas();
		} finally {
			_ventanaPrincipalA.setVisible(false);
			_matricularA.setVisible(true);
			listaAsigMatricA.setEnabled(true);
			tablaAsigMatricA.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
			TableColumnModel tcmTrAp = tablaAsigMatricA.getColumnModel();
			tcmTrAp.getColumn(0).setPreferredWidth(370);

			DefaultTableModel model = (DefaultTableModel) tablaAsigMatricA.getModel();
			while (model.getRowCount() > 0) {
				model.removeRow(0);
			}

			for (int i = 0; i < asignaturasMatriculadas.length; i++) {
				model.addRow(new Object[]{asignaturasMatriculadas[i]});
			}

			boolean existe;
			listaAsigMatricA.removeAllItems();
			for (int i = 0; i < asignaturasPendientes.length; i++) {
				existe = false;
				for (int j = 0; j < asignaturasMatriculadas.length; j++) {
					if (asignaturasPendientes[i].equals(asignaturasMatriculadas[j])) {
						existe = true;
					}
				}
				if (!existe) {
					listaAsigMatricA.addItem(asignaturasPendientes[i]);
				}
			}
		}
    }//GEN-LAST:event_matricularseAActionPerformed

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
		String respuesta = enunciadoNuevaRespuesta.getText();
		if (!preguntaAnyadida) {
			if (!enunciadoNuevaPregunta.getText().equals("") && !respuesta.equals("")) {
				anyadirPregunta();
				preguntaAnyadida = true;
				listaAsignaturasAPP.setEnabled(false);
				listaTemasAPP.setEnabled(false);
			}
		}

		if (!respuesta.equals("") && !enunciadoNuevaPregunta.getText().equals("")) {
			Boolean respOK = okRespuestaAP.isSelected();

			try {
				cliente.anyadirRespuesta(enunciadoNuevaPregunta.getText(), respuesta, respOK);
			} catch (excepcion ex) {
				JOptionPane.showMessageDialog(null, ex.msg, "Error", JOptionPane.ERROR_MESSAGE);
				return; //no debería de ser necesario pero sino lo pongo aunque salte la excepcion sigue ejecutando las líneas de abajo
			}

			int nRespuesta = tablaRespuestasAP.getRowCount() + 1;
			DefaultTableModel model = (DefaultTableModel) tablaRespuestasAP.getModel();
			model.addRow(new Object[]{nRespuesta, respuesta, respOK});
			enunciadoNuevaRespuesta.setText("");
			okRespuestaAP.setSelected(false);
		}
    }//GEN-LAST:event_jButton6ActionPerformed

    private void atrasMatricAActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_atrasMatricAActionPerformed
		_ventanaPrincipalA.setVisible(true);
		_matricularA.setVisible(false);
    }//GEN-LAST:event_atrasMatricAActionPerformed

    private void listaAsigMatricAActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_listaAsigMatricAActionPerformed
		// TODO add your handling code here:
    }//GEN-LAST:event_listaAsigMatricAActionPerformed

    private void matricButtonAActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_matricButtonAActionPerformed
		String asig = (String) listaAsigMatricA.getSelectedItem();

		try {
			cliente.matricular(asig);
			DefaultTableModel model = (DefaultTableModel) tablaAsigMatricA.getModel();
			model.addRow(new Object[]{asig});
			listaAsigMatricA.removeItemAt(listaAsigMatricA.getSelectedIndex());

			if (listaAsigMatricA.getSelectedIndex() == -1) {
				listaAsigMatricA.setEnabled(false);
                                matricButtonA.setEnabled(false);
			}
		} catch (excepcion e) {
			JOptionPane.showMessageDialog(null, e.msg, "Error", JOptionPane.ERROR_MESSAGE);
		}
    }//GEN-LAST:event_matricButtonAActionPerformed

    private void listaAsigMatricPActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_listaAsigMatricPActionPerformed
		// TODO add your handling code here:
    }//GEN-LAST:event_listaAsigMatricPActionPerformed

    private void matricButtonPActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_matricButtonPActionPerformed
		String asig = (String) listaAsigMatricP.getSelectedItem();

		try {
			cliente.matricular(asig);
			DefaultTableModel model = (DefaultTableModel) tablaAsigMatricP.getModel();
			model.addRow(new Object[]{asig});
			listaAsigMatricP.removeItemAt(listaAsigMatricP.getSelectedIndex());

			if (listaAsigMatricP.getSelectedIndex() == -1) {
				listaAsigMatricP.setEnabled(false);
				matricButtonP.setEnabled(false);
			}
		} catch (excepcion e) {
			JOptionPane.showMessageDialog(null, e.msg, "Error", JOptionPane.ERROR_MESSAGE);
		}
    }//GEN-LAST:event_matricButtonPActionPerformed

    private void atrasMatricPActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_atrasMatricPActionPerformed
		_ventanaPrincipalP.setVisible(true);
		_matricularP.setVisible(false);
    }//GEN-LAST:event_atrasMatricPActionPerformed

    private void matricularVPPActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_matricularVPPActionPerformed
		String[] asignaturasMatriculadas = null;
		String[] asignaturasPendientes = null;

		try {
			asignaturasMatriculadas = cliente.getAsignaturasMatriculadas();
			asignaturasPendientes = cliente.getAsignaturas();
		} catch (excepcion e) {
			//No pasa nada si el usuario no está matriculado en ninguna asignatura
			asignaturasMatriculadas = new String[0];
			asignaturasPendientes = cliente.getAsignaturas();
		} finally {
			_ventanaPrincipalP.setVisible(false);
			_matricularP.setVisible(true);
			listaAsigMatricP.setEnabled(true);
			tablaAsigMatricP.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
			TableColumnModel tcmTrAp = tablaAsigMatricP.getColumnModel();
			tcmTrAp.getColumn(0).setPreferredWidth(370);

			DefaultTableModel model = (DefaultTableModel) tablaAsigMatricP.getModel();
			while (model.getRowCount() > 0) {
				model.removeRow(0);
			}

			for (int i = 0; i < asignaturasMatriculadas.length; i++) {
				model.addRow(new Object[]{asignaturasMatriculadas[i]});
			}

			boolean existe;
			listaAsigMatricP.removeAllItems();
			for (int i = 0; i < asignaturasPendientes.length; i++) {
				existe = false;
				for (int j = 0; j < asignaturasMatriculadas.length; j++) {
					if (asignaturasPendientes[i].equals(asignaturasMatriculadas[j])) {
						existe = true;
					}
				}
				if (!existe) {
					listaAsigMatricP.addItem(asignaturasPendientes[i]);
				}
			}
			if (listaAsigMatricP.getSelectedIndex() == -1) {
				listaAsigMatricP.setEnabled(false);
				matricButtonP.setEnabled(false);
			}
		}
    }//GEN-LAST:event_matricularVPPActionPerformed

    private void verNotificacionesBotonVPAActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_verNotificacionesBotonVPAActionPerformed
		_ventanaPrincipalA.setVisible(false);
		_verExamenesA.setVisible(true);
		jTabbedPane1.setSelectedIndex(0);
		mostrarNotificaciones();
    }//GEN-LAST:event_verNotificacionesBotonVPAActionPerformed

	/**
	 * @param args the command line arguments
	 */
	public static void main(String args[]) {
		/*
		 * Set the Nimbus look and feel
		 */
		//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
		 * If Nimbus (introduced in Java SE 6) is not available, stay with the
		 * default look and feel. For details see
		 * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
		 */
		try {
			for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
				if ("Nimbus".equals(info.getName())) {
					javax.swing.UIManager.setLookAndFeel(info.getClassName());
					break;
				}
			}
		} catch (ClassNotFoundException ex) {
			java.util.logging.Logger.getLogger(ClienteGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
		} catch (InstantiationException ex) {
			java.util.logging.Logger.getLogger(ClienteGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
		} catch (IllegalAccessException ex) {
			java.util.logging.Logger.getLogger(ClienteGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
		} catch (javax.swing.UnsupportedLookAndFeelException ex) {
			java.util.logging.Logger.getLogger(ClienteGUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
		}
		//</editor-fold>

		/*
		 * Create and display the form
		 */
		java.awt.EventQueue.invokeLater(new Runnable() {

			public void run() {
				new ClienteGUI().setVisible(true);
			}
		});
	}
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JFrame _anyadirPreguntaP;
    private javax.swing.JFrame _elegirAsignaturas;
    private javax.swing.JFrame _examenResueltoA;
    private javax.swing.JFrame _examenResueltoP;
    private javax.swing.JFrame _hacerExamen;
    private javax.swing.JLabel _incorrectLoginLabel;
    private javax.swing.JButton _loginButton;
    private javax.swing.JFrame _matricularA;
    private javax.swing.JFrame _matricularP;
    private javax.swing.JPasswordField _passwordInput;
    private javax.swing.JLabel _passwordLabel;
    private javax.swing.JFrame _ponerExamen;
    private javax.swing.JTextField _userInput;
    private javax.swing.JLabel _usuarioLabel;
    private javax.swing.JFrame _ventanaPrincipalA;
    private javax.swing.JFrame _ventanaPrincipalP;
    private javax.swing.JFrame _verExamenesA;
    private javax.swing.JFrame _verExamenesP;
    private javax.swing.JFrame _verNotificacionesA;
    private javax.swing.JButton aceptarBotonPEP;
    private javax.swing.JButton anyadirBotonPE;
    private javax.swing.JButton anyadirPreguntaVPP;
    private javax.swing.JButton atrasMatricA;
    private javax.swing.JButton atrasMatricP;
    private datechooser.beans.DateChooserCombo dateFechaFin;
    private datechooser.beans.DateChooserCombo dateFechaInicio;
    private javax.swing.JTextArea enunciadoNuevaPregunta;
    private javax.swing.JTextArea enunciadoNuevaRespuesta;
    private javax.swing.JButton hacerExamen;
    private javax.swing.JButton jButton10;
    private javax.swing.JButton jButton13;
    private javax.swing.JButton jButton14;
    private javax.swing.JButton jButton17;
    private javax.swing.JButton jButton18;
    private javax.swing.JButton jButton19;
    private javax.swing.JButton jButton20;
    private javax.swing.JButton jButton21;
    private javax.swing.JButton jButton22;
    private javax.swing.JButton jButton23;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JComboBox jComboBox6;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JList jList1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane10;
    private javax.swing.JScrollPane jScrollPane11;
    private javax.swing.JScrollPane jScrollPane12;
    private javax.swing.JScrollPane jScrollPane13;
    private javax.swing.JScrollPane jScrollPane14;
    private javax.swing.JScrollPane jScrollPane15;
    private javax.swing.JScrollPane jScrollPane16;
    private javax.swing.JScrollPane jScrollPane17;
    private javax.swing.JScrollPane jScrollPane19;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane20;
    private javax.swing.JScrollPane jScrollPane21;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JScrollPane jScrollPane9;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JLabel labelNPregERA;
    private javax.swing.JLabel labelNPregERP;
    private javax.swing.JLabel labelNPregHE;
    private javax.swing.JComboBox listaAsigMatricA;
    private javax.swing.JComboBox listaAsigMatricP;
    private javax.swing.JComboBox listaAsignaturasAPP;
    private javax.swing.JComboBox listaAsignaturasPE;
    private javax.swing.JComboBox listaExamenesVE;
    private javax.swing.JComboBox listaTemasAPP;
    private javax.swing.JComboBox listaTemasPE;
    private javax.swing.JButton matricButtonA;
    private javax.swing.JButton matricButtonP;
    private javax.swing.JButton matricularVPP;
    private javax.swing.JButton matricularseA;
    private javax.swing.JTextField nPregsPE;
    private javax.swing.JRadioButton okRespuestaAP;
    private javax.swing.JButton ponerExamenVPP;
    private javax.swing.JTextArea preguntaERA;
    private javax.swing.JTextArea preguntaERP;
    private javax.swing.JTextArea preguntaHE;
    private javax.swing.JTextArea respuestaAluERA;
    private javax.swing.JTextArea respuestaAluERP;
    private javax.swing.JTextArea respuestaOkERA;
    private javax.swing.JTextArea respuestaOkERP;
    private javax.swing.JButton salirVPP;
    private javax.swing.JButton salirVPP1;
    private javax.swing.JTable tablaAsigMatricA;
    private javax.swing.JTable tablaAsigMatricP;
    private javax.swing.JTable tablaExamenesA1;
    private javax.swing.JTable tablaExamenesFinA;
    private javax.swing.JTable tablaExamenesVE;
    private javax.swing.JTable tablaNotificacionesA;
    private javax.swing.JTable tablaRespuestasAP;
    private javax.swing.JTable tablaRespuestasHE;
    private javax.swing.JTable tablaTemasPE;
    private javax.swing.JButton terminarExamen;
    private javax.swing.JButton verExamenA;
    private javax.swing.JButton verExamenA1;
    private javax.swing.JButton verExamenVEP;
    private javax.swing.JButton verExamenesA;
    private javax.swing.JButton verExamenesVPP;
    private javax.swing.JButton verNotificacionesBotonVPA;
    private javax.swing.JButton volverExamenResueltoA;
    private javax.swing.JButton volverVEP;
    private javax.swing.JButton volverVerExamenesA;
    private javax.swing.JButton volverVerExamenesA1;
    // End of variables declaration//GEN-END:variables
	private Cliente cliente;
}
